package p.ithorns.sample.office.example;

import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.write.style.ColumnWidth;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;
import p.ithorns.tools.excel.read.ExcelHead;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotEmpty;

/**
 * UserImportXls
 *
 * @author HtL
 * @date 2024/7/10 10:55
 * @since 1.0.0
 */
@Getter
@Setter
public class UserImportXls {

    @NotEmpty
    @ColumnWidth(20)
    @ExcelProperty(index = 0, value = {"姓名", "绰号"})
    private String name;

    @Max(value = 100, message = "不能大于{value}")
    @ExcelProperty(index = 1, value = {"年龄"})
    @ColumnWidth(15)
    private int age;

    // 1-男，2-女 3-未知
    @NotEmpty
    @Range(min = 1, max = 3, message = "只能是1-男，2-女 3-未知")
    @ExcelProperty(index = 2, value = "性别")
    private String gender;

    @ExcelHead(1)
    @ExcelProperty(index = 3, value = {"在哪","地址"})
    private String address;

    @ExcelHead(1)
    @ExcelProperty(index = 4, value = {"合并格","A"})
    private String mergeA;

    @NotEmpty(message = "不能空")
    @ExcelHead(1)
    @ExcelProperty(index = 5, value = {"合并格","B"})
    private String mergeB;

}